import {BasicColumn, FormSchema} from '/@/components/Table';
import {commonStatusDict, commonStatusDictMap} from '/@/utils/dict';

export const columns: BasicColumn[] = [
  {
    title: '支付方式编码',
    dataIndex: 'wayCode',
  },
  {
    title: '支付方式名称',
    dataIndex: 'wayName',
  },
  {
    title: '状态',
    dataIndex: 'status',
    dictFormat: commonStatusDictMap,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'wayCode',
    label: '支付方式编码',
    component: 'Input',
    componentProps: {
      placeholder: '支付方式编码',
    },
    colProps: {span: 6},
  },
  {
    field: 'wayName',
    label: '支付方式名称',
    component: 'Input',
    componentProps: {
      placeholder: '支付方式名称',
    },
    colProps: {span: 6},
  },
  {
    field: 'status',
    label: '状态',
    component: 'Select',
    componentProps: {
      placeholder: '请选择状态',
      options: commonStatusDict,
    },
    colProps: {span: 6},
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: 'ID',
    component: 'Input',
    show: false,
  },
  {
    field: 'wayName',
    label: '支付方式名称',
    component: 'Input',
    componentProps: {
      placeholder: '支付方式名称',
    },
    required: true,
  },
  {
    field: 'wayCode',
    label: '支付方式编码',
    component: 'Input',
    componentProps: {
      placeholder: '支付方式编码',
    },
    required: true,
  },
  {
    field: 'status',
    label: '状态',
    component: 'RadioGroup',
    defaultValue: 1,
    componentProps: {
      options: commonStatusDict,
    },
    required: true,
  },
];
